//package com.chenl.provider.DEMOS.Spring.Bean初始化前后执行操作;
//
//import org.springframework.beans.BeansException;
//import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
//import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
//import org.springframework.beans.factory.support.AbstractBeanDefinition;
//import org.springframework.beans.factory.support.DefaultListableBeanFactory;
//
//import java.util.Map;
//
//public class LazyBeanFactoryProcessor implements BeanFactoryPostProcessor {
//    @Override
//    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
//        DefaultListableBeanFactory fac = (DefaultListableBeanFactory) beanFactory;
//        Map<String, AbstractBeanDefinition> map = (Map<String, AbstractBeanDefinition>) ReflectionTestUtils.getField(fac, "beanDefinitionMap");
//        for (Map.Entry<String, AbstractBeanDefinition> entry : map.entrySet()) {
//            //设置为懒加载
//            entry.getValue().setLazyInit(true);
//        }
//    }
//}
